package com.sky.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;


/*
 * 用户类实体类
 * */

@Data
@Builder
public class User implements Serializable {
    // 用户id
    @NotNull
    private Integer id;
    // 用户名
    private String username;
    // 密码
    @JsonIgnore // 序列化时忽略该字段
    private String password;
    // 邮箱
    @NotNull
    @Email
    private String email;

    // 创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    // 更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
